UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qCFZwfaHyuOBZFsC/zjMTZhFrHp0Kh7uOAuT3pSc3ZQ=' 
WHERE 
  key_id = '9d4e7bda8d5880b61baf7206162972d460d7fd57cdef41968015529f2201d56e' 
  AND (
    token = 'qCFZwfaHyuOBZFsC/zjMTZhFrHp0Kh7uOAuT3pSc3ZQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032