UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ut/38Fl+D8jfWIpvCZQ6X6ETP53Z++aiAnfTWR3/H6A=' 
WHERE 
  key_id = 'd4cd0e943a624a4e5fc598846b526fcf8792319d1feee4ffd2aa6d339953e22c' 
  AND (
    token = 'ut/38Fl+D8jfWIpvCZQ6X6ETP53Z++aiAnfTWR3/H6A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030