UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X9UHFR/bTG1kQxXwqi3xyn0IAnnkcvweY/DP4lJZid0=' 
WHERE 
  key_id = '4c0a0d8a4850a1bd10efc37a0e7877cfe5860f1f523f1b5d44e502ea8646eb16' 
  AND (
    token = 'X9UHFR/bTG1kQxXwqi3xyn0IAnnkcvweY/DP4lJZid0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022