UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XyULtG+T4vJrSTmvhlO+F0b2Of7IT4kCc7XJv5n4LpQ=' 
WHERE 
  key_id = 'bbed884b9ed89e23e301aae9df2fd5aeb34a24d09c7b3136ada96265e3b0a231' 
  AND (
    token = 'XyULtG+T4vJrSTmvhlO+F0b2Of7IT4kCc7XJv5n4LpQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028