UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zjFHrPxRBmnlk5e+lkd3R6lCWVp0860VkJL5RgUdZi8=' 
WHERE 
  key_id = '09c1465780bc552f4a6f444304378cf88dccdb333406c546a6747383091430b7' 
  AND (
    token = 'zjFHrPxRBmnlk5e+lkd3R6lCWVp0860VkJL5RgUdZi8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030