UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1KoM32LB2rSnrvRiutVGRiwJCT+XETEBfL4uVfNvVjs=' 
WHERE 
  key_id = '62f1676928d3cbdaa7f73093bf328665f78df3f3fe814868dbca8c87ca46eb5a' 
  AND (
    token = '1KoM32LB2rSnrvRiutVGRiwJCT+XETEBfL4uVfNvVjs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034