UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qjfOenfE3OP+OruoQOtgl7rUE/+uoZ8ugEk0vYX6uoE=' 
WHERE 
  key_id = '95f02775ea1b70112dd141c0d84439c957394def8517be637b8bc2a3cdad9460' 
  AND (
    token = 'qjfOenfE3OP+OruoQOtgl7rUE/+uoZ8ugEk0vYX6uoE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00073