UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Eq/zXSKhXcT9xs/aJRX8TTT8sPbDUGXYh//8ekVpBAU=' 
WHERE 
  key_id = '5ecc43fcc31d99457ed45a402137d1ceffd35d4c2baf550685b66ad58c26d3c1' 
  AND (
    token = 'Eq/zXSKhXcT9xs/aJRX8TTT8sPbDUGXYh//8ekVpBAU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026