UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aawj+VEpvH+EShaW3AutoLU0lPPMI3vfevlo5hK5vv0=' 
WHERE 
  key_id = '1076578456047dd1621b6394411dfe02e7b5216849a15aaa45ab62605386f936' 
  AND (
    token = 'aawj+VEpvH+EShaW3AutoLU0lPPMI3vfevlo5hK5vv0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052