UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'h1cWATfAHs1DxFTQJUO5sWVYuuiooFMJgcM9MWSxPxA=' 
WHERE 
  key_id = '0e00af4d8085d50fb7a6464d64cb39a1263380977bfc8d090c6dac6b59d470b2' 
  AND (
    token = 'h1cWATfAHs1DxFTQJUO5sWVYuuiooFMJgcM9MWSxPxA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027