UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0nsSbMTFmTe0mDM2yQ80jRd7lbSKG2kSfXSx0J8UPRM=' 
WHERE 
  key_id = '45becabce9267812eb4d965cb331f868713bb33675d394ba2ee61d7275189bd7' 
  AND (
    token = '0nsSbMTFmTe0mDM2yQ80jRd7lbSKG2kSfXSx0J8UPRM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048