UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Jghzpthw93Zz0+6ErKDEl2/E972oBRUJdZIFt62CglE=' 
WHERE 
  key_id = '10facc53925c173cbc5f816bf0cd797b7d871854c43fdc43aeb8d89c5da3742e' 
  AND (
    token = 'Jghzpthw93Zz0+6ErKDEl2/E972oBRUJdZIFt62CglE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058