UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wvjfd5SCZpy2bXmQxXXG1zncxTE2614La2GfAefjnWk=' 
WHERE 
  key_id = '34c93f30084645e07bc5a9c109b2f90f8efc47a0a9fdca129be1cabbdb8f854c' 
  AND (
    token = 'wvjfd5SCZpy2bXmQxXXG1zncxTE2614La2GfAefjnWk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030