UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2KYXUDvLoe8qsJy4KNEVnFdIDDn9DmFyowRCt3ZnNMI=' 
WHERE 
  key_id = '94d406fb5ec6e0e16970ed04a72069261e94660bd054eb1533d35e9fdf756a52' 
  AND (
    token = '2KYXUDvLoe8qsJy4KNEVnFdIDDn9DmFyowRCt3ZnNMI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034