UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BNozINRTn1y8AYigMSe6iusur9no7JAUJzz5WGrufmE=' 
WHERE 
  key_id = '611d19b27f21b358bf4ebcb7e92fa81977d1fd4fac0a0e7323cc0cc8adef9d8f' 
  AND (
    token = 'BNozINRTn1y8AYigMSe6iusur9no7JAUJzz5WGrufmE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019