UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rcKI+gX9QCOMB4LuGW0xCYJjH9Ayfx1Qyrkr12c5MpY=' 
WHERE 
  key_id = 'dfe99e13efdb5d4f72792a3fe93461698445590d532ac5705d35bb267d7eef42' 
  AND (
    token = 'rcKI+gX9QCOMB4LuGW0xCYJjH9Ayfx1Qyrkr12c5MpY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021