UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/kK++ZBHMkowrQd9/ggoIu6n9xS0jx0fgzKibDcDv4I=' 
WHERE 
  key_id = '1d5c3ad4bbe603a62b8094d9b7a61089a6df8819d5862e1a30783130ef9c1686' 
  AND (
    token = '/kK++ZBHMkowrQd9/ggoIu6n9xS0jx0fgzKibDcDv4I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060