UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oKmk9begGRXRzrIc6t3/Wi7VT8qM5s8kKI/uDsibatU=' 
WHERE 
  key_id = '6449da6be74c84804f68b6f9a25e71be7a927c87e27ee8888e4d090b94f2d270' 
  AND (
    token = 'oKmk9begGRXRzrIc6t3/Wi7VT8qM5s8kKI/uDsibatU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031