UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Dc10pAwtZr6jFAHifrmesxBfLaEVMbgR23vrkmz4tFU=' 
WHERE 
  key_id = 'bc35558682475499204c6fcabae0a415c689570e88bf49f75f50c00727f136a6' 
  AND (
    token = 'Dc10pAwtZr6jFAHifrmesxBfLaEVMbgR23vrkmz4tFU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043