UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+pVry5GFVDbvL17k/OwdfQlH8LUJX9oD3dwSQyx5gwk=' 
WHERE 
  key_id = '71ff51dc064a9940aaea3ad5c915ef15afc149d47e5de2b5a32e418aabc05ff2' 
  AND (
    token = '+pVry5GFVDbvL17k/OwdfQlH8LUJX9oD3dwSQyx5gwk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00070