UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UwXC/G2SoZqF/AUrx57O2PMWbtzP4RX/4/CAexw/mKY=' 
WHERE 
  key_id = 'ec21c38b14b4ce0c1819dcbd3ef04318445624cc00e197c0419abbcd2a3abe0d' 
  AND (
    token = 'UwXC/G2SoZqF/AUrx57O2PMWbtzP4RX/4/CAexw/mKY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031