UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EvD4CNuLATzF6PhxbRaOV5Mo0HBns8104qW3qn00IUI=' 
WHERE 
  key_id = '234757c1791de8d0fa2c291f43f33d8ceb3d83f518f044f523866dd3cebfaa67' 
  AND (
    token = 'EvD4CNuLATzF6PhxbRaOV5Mo0HBns8104qW3qn00IUI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049