UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4WG4L4Dm6cUQwwlN2PdhcgxS/ifHVfwcs+l9Fk1r1k8=' 
WHERE 
  key_id = '222c7dfd51bef822e3a12bcd0c6c3062363b4fefd2833f9fb0f3c8f4e16d7bda' 
  AND (
    token = '4WG4L4Dm6cUQwwlN2PdhcgxS/ifHVfwcs+l9Fk1r1k8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028