UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9z5tJKDyRiFEwNB1V3/ucdSAnhZmv7RhQ0JHwbb7KBU=' 
WHERE 
  key_id = 'a34b9a90d3b71a926cf3f19264306ec034ebef748dab0c738523e781e8e9cd97' 
  AND (
    token = '9z5tJKDyRiFEwNB1V3/ucdSAnhZmv7RhQ0JHwbb7KBU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039