UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bxwDUZkf0Jkv/2hy6qRg0NM5b4cvWwy/URASFo96/G0=' 
WHERE 
  key_id = 'f5015026ec6050eb35ab05be4c742c2af698ae216affdc5300ae537ea226c186' 
  AND (
    token = 'bxwDUZkf0Jkv/2hy6qRg0NM5b4cvWwy/URASFo96/G0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034