UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ha0B/K8fP/3FMbK536fIAxHqi/zza7Ls7pUi42nQtUI=' 
WHERE 
  key_id = '490e5fb60cd59afd239a475123197c0a206b81a2eed689e6092acd25f39545a6' 
  AND (
    token = 'Ha0B/K8fP/3FMbK536fIAxHqi/zza7Ls7pUi42nQtUI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00013