UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UNoFwFKDE+aQNoWYNULMnl59c2gwMt+4iuI0AJnCEi8=' 
WHERE 
  key_id = '5bcbb68dbdca077aa0fc40153254e779f961335810de7b2755484f210a084ca4' 
  AND (
    token = 'UNoFwFKDE+aQNoWYNULMnl59c2gwMt+4iuI0AJnCEi8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043