UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9dP6aa2UoQGJ5xZ4wYN2U1qXSpe/KR6hjyNPek7kTww=' 
WHERE 
  key_id = 'a6ac1c5f7700f84892e396ade6df7aae5ac7469b322114ca8ff6ed630ca917d8' 
  AND (
    token = '9dP6aa2UoQGJ5xZ4wYN2U1qXSpe/KR6hjyNPek7kTww=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058