UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SiKmOvxLIxpfWTiXhPgeOJQlZvFOEJ5u8D5G+lVj14g=' 
WHERE 
  key_id = '22e22af03808bf9761477172f688628221580e381628bf7b9b38de23578c1c70' 
  AND (
    token = 'SiKmOvxLIxpfWTiXhPgeOJQlZvFOEJ5u8D5G+lVj14g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034