UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KRqiUxNmk42MSasRM9UQwnzeDxX5wQi0t7Nk/7OPl+g=' 
WHERE 
  key_id = '367636ac33cb8b4ce9879747a2a09bfd860896ca6a6804ce6f50c0e6e562183b' 
  AND (
    token = 'KRqiUxNmk42MSasRM9UQwnzeDxX5wQi0t7Nk/7OPl+g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036