UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wQlbWMt/yiKeq334hlwaJ0AqOHFJaxTsbhsVmpH4BKE=' 
WHERE 
  key_id = 'd949b41a2df5af660ad26d92d8d60d5eebaaecaa1c04e17fe4dce20ed07e4d1d' 
  AND (
    token = 'wQlbWMt/yiKeq334hlwaJ0AqOHFJaxTsbhsVmpH4BKE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041